package myschool.biz;

import myschool.dao.GradeDao;
import myschool.entity.Grade;
import myschool.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class GradeService {
    public static final GradeService ME=new GradeService();

    public List<Grade> findAll() {
        SqlSession s = MybatisUtil.get();
        try {
            GradeDao mapper = s.getMapper(GradeDao.class);
            return mapper.findAll();
        } finally {
            MybatisUtil.close(s);
        }
    }


}
